import $api from '@/http/api.js'

export default {
  namespaced: true,
  state: {
    subjects: [],
    total: 0
  },
  mutations: {
    GetSubject(state, payload) {
      state.subjects = payload.rows
      state.total = payload.total
    }
  },
  actions: {
    getSubject(context, data) {
      $api.subjectApi.getSubjects(data).then(({ data }) => {
        context.commit('GetSubject', data.data)
      })
    }
  },
}